﻿#ifndef QMYINIFILE_H
#define QMYINIFILE_H

#include <QString>
#include <QSettings>
#include <QTextCodec>
#include <QVariant>

class QMyIniFile
{
    QSettings *m_psettings;
    QTextCodec *m_cfg_codec;

    void clear();
public:
    QMyIniFile();
    virtual ~QMyIniFile();

    bool Open(const QString &fileName);
    bool changeCodec(QTextCodec* codec = Q_NULLPTR);

    QVariant GetValue(const QString& qstrSegName, const QString& qstrKeyName, const QVariant& defaultValue = QVariant());
    bool SetValue(const QString& qstrSegName, const QString& qstrKeyName, const QVariant& qValue);
};

#endif // QMYINIFILE_H
